<?php
namespace BP\Port;

use BP\En\EntityNoName;

require_once("BP/En/Map.php");
class Dept extends EntityNoName {
	protected $_HisSubDepts;	// Depts
	private function __init() { // default class members
		$this->_HisSubDepts = NULL;
	}
	public function getParentNo () 
	{
		return $this->GetValStrByKey(DeptAttr::$ParentNo);
	}
	public function setParentNo ($value) // [String value]
	{
		$this->SetValByKey(DeptAttr::$ParentNo, $value);
	}
	public function getGrade () 
	{
		return 1;
	}
	public function getHisSubDepts () 
	{
		if (($this->_HisSubDepts == NULL))
		{
			$this->_HisSubDepts = Depts::constructor__String($this->getNo());
		}
		return $this->_HisSubDepts;
	}
	public static function constructor__ () 
	{
		$me = new self();
		$me->__init();
		return $me;
	}
	public static function constructor__String ($no) // [String no]
	{
		$me = new self();
		$me->__init();
		return $me;
	}
	public function getHisUAC () 
	{
		$uac = new UAC();
		$uac->OpenForSysAdmin();
		return $uac;
	}
	public function getEnMap () 
	{
		if (($this->get_enMap() != NULL))
		{
			return $this->get_enMap();
		}
		$map = new Map();
		$map->setEnDBUrl(new DBUrl($DBUrlType->AppCenterDSN));
		$map->setPhysicsTable("Port_Dept");
		$map->Java_SetEnType($EnType->Admin);
		$map->IsEnableVer =  TRUE ;
		$map->setEnDesc("部门");
		$map->Java_SetDepositaryOfEntity($Depositary->Application);
		$map->Java_SetDepositaryOfMap($Depositary->Application);
		$map->AddTBStringPK(DeptAttr::$No, NULL, "编号",  TRUE ,  FALSE , 1, 50, 20);
		$map->AddTBString(DeptAttr::$Name, NULL, "名称",  TRUE ,  FALSE , 0, 100, 30);
		$map->AddTBString(DeptAttr::$ParentNo, NULL, "父节点编�?",  TRUE ,  TRUE , 0, 100, 30);
		$rm = new RefMethod();
		$rm->Title = "历史变更";
		$rm->ClassMethodName = ($this . ".History");
		$rm->refMethodType = $RefMethodType->RightFrameOpen;
		$map->AddRefMethod($rm);
		$this->set_enMap($map);
		return $this->get_enMap();
	}
	public function History () 
	{
		return ((("EnVerDtl.htm?EnName=" . $this) . "&PK=") . $this->getNo());
	}
	public function Retrieve () 
	{
		return parent->Retrieve();
	}
	public function RetrieveFromDBSources () 
	{
		return parent->RetrieveFromDBSources();
	}
}
?>
